package com.example.drawerlayoutbottom;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    private DrawerLayoutBottom drawerLayoutBottom;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        drawerLayoutBottom = findViewById(R.id.drawer);
        drawerLayoutBottom.setLayoutOpenCloseListener(new DrawerLayoutBottom.LayoutOpenCloseListener() {
            @Override
            public void onClosed() {
                Toast.makeText(MainActivity.this, "关闭", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onOpened() {
                Toast.makeText(MainActivity.this, "打开", Toast.LENGTH_SHORT).show();
            }
        });
    }
}